import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/views/layout/Layout'

/** note: Submenu only appear when children.length>=1
 *  detail see  https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 **/

/**
* hidden: true                   if `hidden:true` will not show in the sidebar(default is false)
* alwaysShow: true               if set true, will always show the root menu, whatever its child routes length
*                                if not set alwaysShow, only more than one route under the children
*                                it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect           if `redirect:noredirect` will no redirect in the breadcrumb
* name:'router-name'             the name is used by <keep-alive> (must set!!!)
* meta : {
    perms: ['GET /aaa','POST /bbb']     will control the page perms (you can set multiple perms)
    title: 'title'               the name show in submenu and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar,
    noCache: false                if true ,the page will no be cached(default is false)
  }
**/
export const constantRoutes = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/redirect/index')
      }
    ],
    meta: {
      show: false
    }
  },
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true,
    meta: {
      show: false
    }
  },
  {
    path: '/LoginPage',
    name: 'LoginPage',
    component: () => import('@/views/login/LoginPage'),
    hidden: true,
    meta: {
      show: false
    }
  },
  {
    path: '/BindingPhone',
    name: 'BindingPhone',
    component: () => import('@/views/login/BindingPhone'),
    meta: {
      show: false
    }
  },
  {
    path: '/auth-redirect',
    component: () => import('@/views/login/authredirect'),
    hidden: true
  },
  {
    path: '/404',
    component: () => import('@/views/errorPage/404'),
    hidden: true
  },
  {
    path: '/401',
    component: () => import('@/views/errorPage/401'),
    hidden: true
  },
  {
    path: '/shop/manager',
    component: () => import('@/views/shop/manager/index'),
    name: 'ShopManager',
    hidden: true,
    meta: {
      noCache: false,
      show: false
    }
  },

  {
    path: '/shop/manager/AddShop',
    component: () => import('@/views/dashboard/addShop'),
    name: 'AddShop',
    hidden: true,
    meta: {
      show: false
    }
  },
  /* {
    path: '/shop/manager/VerShopDetails',
    component: () => import('@/views/dashboard/VerShopDetails'),
    name: 'VerShopDetails',
    hidden: true,
    meta: {
      show: false
    }
  },*/
  {
    path: '/shop/manager/UserShopDetails',
    component: () => import('@/views/dashboard/UserShopDetails'),
    name: 'UserShopDetails',
    hidden: true,
    meta: {
      show: false
    }
  },
  {
    path: '',
    component: Layout,
    redirect: '/shop/manager',
    meta: {
      title: '首页',
      icon: 'el-icon-house'
    },
    children: [
      {
        path: 'MainPage',
        component: () => import('@/views/dashboard/mianPage'),
        name: 'MainPage',
        meta: { title: '运营数据', icon: 'el-icon-coin', affix: true, show: true }
      },
      {
        path: 'AccessData',
        component: () => import('@/views/dashboard/AccessData'),
        name: 'AccessData',
        meta: { title: '访问数据', icon: 'el-icon-s-marketing', affix: false, show: true }
      }
    ]
  }
]

export const asyncRoutes = [
  {
    path: '/Commodity',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'Commodity',
    meta: {
      title: '商品',
      icon: 'el-icon-goods'
    },
    children: [
      {
        path: 'StoreSetting',
        component: () => import('@/views/Commodity/storeSetting'),
        name: 'StoreSetting',
        meta: {
          title: '门店设置',
          noCache: false,
          show: false
        }
      },
      {
        path: 'EditStoreSetting',
        component: () => import('@/views/Commodity/editStoreSetting'),
        name: 'EditStoreSetting',
        meta: {
          title: '单门店商品设置',
          noCache: false,
          show: false
        }
      },
      {
        path: 'CommodityManagement',
        component: () => import('@/views/Commodity/CommodityManagement'),
        name: 'CommodityManagement',
        meta: {
          title: '商品管理',
          noCache: true,
          show: true
        }
      },
      {
        path: 'DescriptionSettings',
        component: () => import('@/views/Commodity/DescriptionSettings'),
        name: 'DescriptionSettings',
        meta: {
          title: '说明设置',
          noCache: false,
          show: true
        }
      },
      {
        path: 'afterSaleDescription',
        component: () => import('@/views/Commodity/afterSaleDescription'),
        name: 'afterSaleDescription',
        meta: {
          title: '售后说明',
          noCache: false,
          show: true
        }
      },
      {
        path: 'AddGoods',
        component: () => import('@/views/Commodity/childpage/addCommodity'),
        name: 'AddGoods',
        meta: {
          title: '新增商品',
          noCache: false,
          show: false
        }
      },
      {
        path: 'CopyGoods',
        component: () => import('@/views/Commodity/childpage/addCommodity'),
        name: 'CopyGoods',
        meta: {
          title: '复制商品',
          noCache: false,
          show: false
        }
      },
      {
        path: 'EditGoods',
        component: () => import('@/views/Commodity/childpage/addCommodity'),
        name: 'EditGoods',
        meta: {
          title: '编辑商品',
          noCache: false,
          show: false
        }
      },
      {
        path: 'Relation',
        component: () => import('@/views/Commodity/childpage/relation'),
        name: 'Relation',
        meta: {
          title: '关联门店管理',
          noCache: false,
          show: false
        }
      },
      {
        path: 'AddType',
        component: () => import('@/views/Commodity/component/addtype'),
        name: 'AddType',
        meta: {
          title: '添加分类',
          noCache: false,
          show: false
        }
      }
    ]
  },

  {
    path: '/OrderManagement',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'mallManage',
    meta: {
      title: '订单',
      icon: 'el-icon-s-order'
    },
    children: [
      {
        path: 'RentAndSale',
        component: () => import('@/views/OrderManagement/RentAndSale'),
        name: 'RentAndSale',
        meta: {
          title: '租售订单',
          noCache: true,
          show: true
        }
      },
      /** 在线服务订单 */
      {
        path: 'OnlineOrder',
        component: () => import('@/views/OrderManagement/OnlineOrder'),
        name: 'OnlineOrder',
        meta: {
          title: '在线服务订单',
          noCache: false,
          show: true
        }
      },
      {
        path: 'OnlineDetail',
        component: () => import('@/views/OrderManagement/onlineDetails'),
        name: 'OnlineDetail',
        meta: {
          title: '线上订单详情',
          noCache: false,
          show: false
        }
      },
      /** 售后维权 */
      {
        path: 'aftersale',
        component: () => import('@/views/OrderManagement/aftersale'),
        name: 'aftersale',
        meta: {
          title: '售后维权',
          noCache: false,
          show: true
        }
      },
      /** 售后维权详情 */
      {
        path: 'afterSaleDetails',
        component: () => import('@/views/OrderManagement/afterSaleDetails'),
        name: 'afterSaleDetails',
        meta: {
          title: '售后维权详情',
          noCache: false,
          show: false
        }
      },
      {
        path: 'orderSetting',
        component: () => import('@/views/OrderManagement/orderSetting'),
        name: 'orderSetting',
        meta: {
          title: '订单设置',
          noCache: false,
          show: true
        }
      },
      {
        path: 'YWC',
        component: () => import('@/views/OrderManagement/pages/YWC'),
        name: 'YWC',
        meta: {
          title: '已完成',
          noCache: false,
          show: false
        }
      },
      {
        path: 'DJS',
        component: () => import('@/views/OrderManagement/pages/YWC'),
        name: 'DJS',
        meta: {
          title: '待用户结算',
          noCache: false,
          show: false
        }
      },
      {
        path: 'DQH',
        component: () => import('@/views/OrderManagement/pages/YWC'),
        name: 'DQH',
        meta: {
          title: '待取货',
          noCache: false,
          show: false
        }
      },
      {
        path: 'SYZ',
        component: () => import('@/views/OrderManagement/pages/YWC'),
        name: 'SYZ',
        meta: {
          title: '使用中',
          noCache: false,
          show: false
        }
      },
      {
        path: 'DSHSH',
        component: () => import('@/views/OrderManagement/pages/YWC'),
        name: 'DSHSH',
        meta: {
          title: '待商户收货',
          noCache: false,
          show: false
        }
      },
      {
        path: 'DYHSH',
        component: () => import('@/views/OrderManagement/pages/YWC'),
        name: 'DYHSH',
        meta: {
          title: '待用户收货',
          noCache: false,
          show: false
        }
      },
      {
        path: 'DYHZT',
        component: () => import('@/views/OrderManagement/pages/YWC'),
        name: 'DYHZT',
        meta: {
          title: '待用户自提',
          noCache: false,
          show: false
        }
      },
      {
        path: 'TBRBTUModify',
        component: () => import('@/views/OrderManagement/pages/TBRBTUModify'),
        name: 'TBRBTUModify',
        meta: {
          title: '发货信息',
          noCache: false,
          show: false
        }
      },
      {
        path: 'PendingPayment',
        component: () => import('@/views/OrderManagement/pages/PendingPayment'),
        name: 'PendingPayment',
        meta: {
          title: '待付款',
          noCache: false,
          show: false
        }
      },
      {
        path: 'Consignment',
        component: () => import('@/views/OrderManagement/pages/Consignment'),
        name: 'Consignment',
        meta: {
          title: '待发货',
          noCache: false,
          show: false
        }
      },
      {
        path: 'updatePrice',
        component: () => import('@/views/OrderManagement/pages/updatePrice'),
        name: 'updatePrice',
        meta: {
          title: '订单改价',
          noCache: false,
          show: false
        }
      },
      {
        path: 'closed',
        component: () => import('@/views/OrderManagement/pages/YWC'),
        name: 'closed',
        meta: {
          title: '已关闭',
          noCache: false,
          show: false
        }
      },
      {
        path: 'SafeguardDetails',
        component: () => import('@/views/OrderManagement/SafeguardDetails'),
        name: 'SafeguardDetails',
        meta: {
          title: '订单详情',
          noCache: false,
          show: false
        }
      }
    ]
  },

  {
    path: '/service',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'service',
    meta: {
      title: '服务',
      icon: 'el-icon-office-building'
    },
    children: [
      {
        path: 'OnlineService',
        component: () => import('@/views/service/OnlineService'),
        name: 'OnlineService',
        meta: {
          title: '在线服务',
          noCache: true,
          show: true
        }
      },
      {
        path: 'addOnlineService',
        component: () => import('@/views/service/childpage/addService'),
        name: 'addOnlineService',
        meta: {
          title: '增加在线服务',
          noCache: true,
          show: false
        }
      },
      {
        path: 'editOnlineService',
        component: () => import('@/views/service/childpage/addService'),
        name: 'editOnlineService',
        meta: {
          title: '编辑在线服务',
          noCache: true,
          show: false
        }
      },
      {
        path: 'copyOnlineService',
        component: () => import('@/views/service/childpage/addService'),
        name: 'copyOnlineService',
        meta: {
          title: '复制在线服务',
          noCache: true,
          show: false
        }
      },
      {
        path: 'operateCity',
        component: () => import('@/views/service/childpage/operateCity'),
        name: 'operateCity',
        meta: {
          title: '运营城市管理',
          noCache: true,
          show: false
        }
      },
      {
        path: 'priceSetting',
        component: () => import('@/views/service/childpage/secondpage/priceSetting'),
        name: 'priceSetting',
        meta: {
          perms: ['GET /admin/goods/list', 'POST /admin/goods/delete'],
          title: '价格设置',
          noCache: true,
          show: false
        }
      },
      {
        path: 'addServiceTime',
        component: () => import('@/views/service/childpage/secondpage/addServiceTime'),
        name: 'shiftTable',
        meta: {
          perms: ['GET /admin/goods/list', 'POST /admin/goods/delete'],
          title: '增加服务时间模板',
          noCache: true,
          show: false
        }
      },
      {
        path: 'DoorToDoorService',
        component: () => import('@/views/service/DoorToDoorService'),
        name: 'DoorToDoorService',
        meta: {
          perms: ['POST /admin/goods/create'],
          title: '商品上架',
          noCache: false,
          show: false
        }
      },
      {
        path: 'DoctorManagement',
        component: () => import('@/views/service/DoctorManagement'),
        name: 'DoctorManagement',
        meta: {
          title: '医生管理',
          noCache: true,
          show: true
        }
      },
      {
        path: 'AddDoctor',
        component: () => import('@/views/service/childpage/addDoctor'),
        name: 'AddDoctor',
        meta: {
          title: '新增医生',
          noCache: false,
          show: false
        }
      },
      {
        path: 'EditDoctor',
        component: () => import('@/views/service/childpage/EditDoctor'),
        name: 'EditDoctor',
        meta: {
          title: '编辑医生',
          noCache: false,
          show: false
        }
      },
      {
        path: 'countService',
        component: () => import('@/views/service/childpage/countService'),
        name: 'countService',
        meta: {
          perms: ['GET /admin/goods/detail', 'POST /admin/goods/update', 'POST /admin/goods/catAndBrand'],
          title: '服务统计',
          noCache: false,
          show: false
        }
      },
      {
        path: 'serviceTable',
        component: () => import('@/views/service/childpage/secondpage/serviceTable'),
        name: 'serviceTable',
        meta: {
          perms: ['GET /admin/goods/detail', 'POST /admin/goods/update', 'POST /admin/goods/catAndBrand'],
          title: '服务统计',
          noCache: false,
          show: false
        }
      },
      {
        path: 'DepartmentManagement',
        component: () => import('@/views/service/DepartmentManagement'),
        name: 'DepartmentManagement',
        meta: {
          perms: ['GET /admin/goods/detail', 'POST /admin/goods/update', 'POST /admin/goods/catAndBrand'],
          title: '科室管理',
          noCache: false,
          show: true
        }
      }
    ]
  },
  {
    path: '/LockItem',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'LockItem',
    meta: {
      title: '锁具',
      icon: 'el-icon-lock'
    },
    children: [
      {
        path: 'Chain',
        component: () => import('@/views/LockItem/chain'),
        name: 'Chain',
        meta: {
          title: '链条锁',
          noCache: false,
          show: true
        }
      },
      // {
      //   path: 'Lattice',
      //   component: () => import('@/views/LockItem/lattice'),
      //   name: 'Lattice',
      //   meta: {
      //     title: '格子柜索',
      //     noCache: false,
      //     show: true
      //   }
      // },
      {
        path: 'MedicalG',
        component: () => import('@/views/LockItem/MedicalG'),
        name: 'MedicalG',
        meta: {
          title: '医柜锁',
          noCache: false,
          show: true
        }
      },
      {
        path: 'LockAddEquipment',
        component: () => import('@/views/LockItem/component/add/addequipment'),
        name: 'LockAddEquipment',
        meta: {
          title: '新增RFID设备',
          noCache: false,
          show: false
        }
      },
      {
        path: 'AddControl',
        component: () => import('@/views/LockItem/component/add/addcontrol'),
        name: 'AddControl',
        meta: {
          title: '新增控制器',
          noCache: false,
          show: false
        }
      },
      {
        path: 'AddMedicalGControl',
        component: () => import('@/views/LockItem/component/add/AddMedicalGControl'),
        name: 'AddMedicalGControl',
        meta: {
          title: '新增医柜锁',
          noCache: false,
          show: false
        }
      },
      {
        path: 'MedicalGDetail',
        component: () => import('@/views/LockItem/component/MedicalGDetail'),
        name: 'MedicalGDetail',
        meta: {
          title: '医柜锁商品管理',
          noCache: false,
          show: false
        }
      },
      {
        path: 'AddBarGun',
        component: () => import('@/views/LockItem/component/add/AddBarGun'),
        name: 'AddBarGun',
        meta: {
          title: '新增扫码枪',
          noCache: false,
          show: false
        }
      },
      {
        path: 'AddCommodity',
        component: () => import('@/views/LockItem/component/add/AddCommodity'),
        name: 'AddCommodity',
        meta: {
          title: '新增RFID商品',
          noCache: false,
          show: false
        }
      }
    ]
  },
  {
    path: '/market',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'marketManage',
    meta: {
      title: '营销',
      icon: 'el-icon-s-finance'
    },
    children: [
      {
        path: 'packList',
        component: () => import('@/views/market/pack'),
        name: 'pack',
        meta: {
          title: '打包活动',
          noCache: false,
          show: true
        }
      },
      {
        path: 'addPack',
        component: () => import('@/views/market/childpage/addPack'),
        name: 'addPack',
        meta: {
          title: '新增打包活动',
          noCache: false,
          show: false
        }
      },
      {
        path: 'activeDetail',
        component: () => import('@/views/market/childpage/activeDetail'),
        name: 'ActiveDetail',
        meta: {
          title: '打包活动详情',
          noCache: false,
          show: false
        }
      },
      {
        path: 'gift',
        component: () => import('@/views/market/gift'),
        name: 'gift',
        meta: {
          title: '满减满赠',
          noCache: false,
          show: true
        }
      },
      {
        path: 'addGift',
        component: () => import('@/views/market/childpage/addGift'),
        name: 'addGift',
        meta: {
          title: '新增满减满赠活动',
          noCache: false,
          show: false
        }
      },
      {
        path: 'giftDetail',
        component: () => import('@/views/market/childpage/giftDetail'),
        name: 'giftDetail',
        meta: {
          title: '满减满赠活动详情',
          noCache: false,
          show: false
        }
      },
      {
        path: 'deductTax',
        component: () => import('@/views/market/deductTax'),
        name: 'deductTax',
        meta: {
          title: '抵扣金',
          noCache: false,
          show: true
        }
      },
      {
        path: 'addDeductTax',
        component: () => import('@/views/market/childpage/addDeductTax'),
        name: 'addDeductTax',
        meta: {
          title: '新增抵扣金规则',
          noCache: false,
          show: false
        }
      },
      {
        path: 'editDeductTax',
        component: () => import('@/views/market/childpage/editDeductTax'),
        name: 'editDeductTax',
        meta: {
          title: '编辑抵扣金规则',
          noCache: false,
          show: false
        }
      },
      {
        path: 'deductTaxTable',
        component: () => import('@/views/market/childpage/deductTaxTable'),
        name: 'deductTaxTable',
        meta: {
          title: '抵扣金统计',
          noCache: false,
          show: false
        }
      },
      {
        path: 'deductTaxDetail',
        component: () => import('@/views/market/childpage/deductTaxDetail'),
        name: 'deductTaxDetail',
        meta: {
          title: '抵扣金详情',
          noCache: false,
          show: false
        }
      }
      // {
      //   path: 'meal',
      //   component: () => import('@/views/market/meal'),
      //   name: 'meal',
      //   meta: {
      //     title: '套餐',
      //     noCache: false,
      //     show: true
      //   }
      // }
    ]
  },
  {
    path: '/finance',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'financeManage',
    meta: {
      title: '财务',
      icon: 'el-icon-bank-card'
    },
    children: [
      {
        path: 'finance',
        component: () => import('@/views/finance/financeCount'),
        name: 'financeCount',
        meta: {
          title: '财务统计',
          noCache: false,
          show: true
        }
      },
      {
        path: 'withdrawRecord',
        component: () => import('@/views/finance/childpage/withdrawRecord'),
        name: 'withdrawRecord',
        meta: {
          title: '提现记录',
          noCache: false,
          show: false
        }
      },
      {
        path: 'shareStatistics',
        component: () => import('@/views/finance/childpage/shareStatistics'),
        name: 'shareStatistics',
        meta: {
          title: '商户分成收益金额统计',
          noCache: false,
          show: false
        }
      },
      {
        path: 'shareDetail',
        component: () => import('@/views/finance/childpage/template/shareDetail'),
        name: 'shareDetail',
        meta: {
          title: '商户分成收益金额详情',
          noCache: false,
          show: false
        }
      }
    ]
  },
  {
    path: '/shop',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    name: 'shop',
    meta: {
      title: '店铺',
      icon: 'el-icon-s-shop'
    },
    children: [
      /** 推广管理 */
      {
        path: 'ExtensionManagement',
        component: () => import('@/views/shop/ExtensionManagement'),
        name: 'ExtensionManagement',
        meta: {
          title: '推广管理',
          noCache: false,
          show: true
        }
      },
      {
        path: 'WebPageManagement',
        component: () => import('@/views/shop/WebPageManagement'),
        name: 'WebPageManagement',
        meta: {
          title: '网页管理',
          noCache: false,
          show: true
        }
      },
      {
        path: 'AddWebPage',
        component: () => import('@/views/shop/pages/AddWebPage'),
        name: 'AddWebPage',
        meta: {
          title: '添加网页',
          noCache: true,
          show: false
        }
      },
      {
        path: 'EditWebPage',
        component: () => import('@/views/shop/pages/EditWebPage'),
        name: 'EditWebPage',
        meta: {
          title: '编辑网页',
          noCache: true,
          show: false
        }
      },
      {
        path: 'AddExtensionPre',
        component: () => import('@/views/shop/pages/AddExtensionPre'),
        name: 'AddExtensionPre',
        meta: {
          title: '添加推广员',
          noCache: true,
          show: false
        }
      },
      {
        path: 'EditExtensionPre',
        component: () => import('@/views/shop/pages/AddExtensionPre'),
        name: 'EditExtensionPre',
        meta: {
          title: '编辑推广员',
          noCache: false,
          show: false
        }
      },
      /* {
        path: 'ShowExtensionPre',
        component: () => import('@/views/shop/pages/AddExtensionPre'),
        name: 'ShowExtensionPre',
        meta: {
          title: '推广员详情',
          noCache: true,
          show: false
        }
      },*/
      {
        path: 'AddPlan',
        component: () => import('@/views/shop/pages/AddPlan'),
        name: 'AddPlan',
        meta: {
          title: '添加方案',
          noCache: false,
          show: false
        }
      },
      {
        path: 'EditPlan',
        component: () => import('@/views/shop/pages/EditPlan'),
        name: 'EditPlan',
        meta: {
          title: '编辑方案',
          noCache: false,
          show: false
        }
      },
      {
        path: 'ShowPlan',
        component: () => import('@/views/shop/pages/AddPlan'),
        name: 'ShowPlan',
        meta: {
          title: '方案详情',
          noCache: true,
          show: false
        }
      },
      {
        path: 'AddGoodsShop',
        component: () => import('@/views/shop/pages/AddGoodsShop'),
        name: 'AddGoodsShop',
        meta: {
          title: '单门店商品设置',
          noCache: false,
          show: false
        }
      },
      {
        path: 'StaticExtensionDetail',
        component: () => import('@/views/shop/pages/StaticExtensionDetail'),
        name: 'StaticExtensionDetail',
        meta: {
          title: '推广详情',
          noCache: false,
          show: false
        }
      },
      {
        path: 'ExtensionDetail',
        component: () => import('@/views/shop/pages/ExtensionDetail'),
        name: 'ExtensionDetail',
        meta: {
          title: '推广员详情',
          noCache: false,
          show: false
        }
      },
      {
        path: 'TableDetail',
        component: () => import('@/views/shop/pages/tableDetail'),
        name: 'TableDetail',
        meta: {
          title: '记录',
          noCache: false,
          show: false
        }
      },
      /** 云仓 */
      {
        path: 'GloudWarehouse',
        component: () => import('@/views/shop/GloudWarehouse'),
        name: 'GloudWarehouse',
        meta: {
          title: '云仓管理',
          noCache: false,
          show: true
        }
      },
      {
        path: 'EditGloudWarehouse',
        component: () => import('@/views/shop/pages/AddGloudWarehouse'),
        name: 'EditGloudWarehouse',
        meta: {
          title: '编辑云仓',
          noCache: true,
          show: false
        }
      },
      {
        path: 'AddGloudWarehouse',
        component: () => import('@/views/shop/pages/AddGloudWarehouse'),
        name: 'AddGloudWarehouse',
        meta: {
          title: '新增云仓',
          noCache: true,
          show: false
        }
      },
      {
        path: 'SPKManage',
        component: () => import('@/views/shop/pages/SPKManage'),
        name: 'SPKManage',
        meta: {
          title: '商品库存管理',
          noCache: true,
          show: false
        }
      },
      {
        path: 'InventoryManagement',
        component: () => import('@/views/shop/pages/InventoryManagement'),
        name: 'InventoryManagement',
        meta: {
          title: '云仓管理',
          noCache: false,
          show: false
        }
      },
      /** 运维费模板 */
      {
        path: 'YWFTemplate',
        component: () => import('@/views/shop/YWFTemplate'),
        name: 'YWFTemplate',
        meta: {
          title: '运维费模板',
          noCache: false,
          show: true
        }
      },
      {
        path: 'AddYWFTemplate',
        component: () => import('@/views/shop/pages/AddYWFTemplate'),
        name: 'AddYWFTemplate',
        meta: {
          title: '添加模板',
          noCache: true,
          show: false
        }
      },
      /** 收费模板 */
      {
        path: 'CollectMoneyTemplate',
        component: () => import('@/views/shop/CollectMoneyTemplate'),
        name: 'CollectMoneyTemplate',
        meta: {
          title: '收费模板',
          noCache: false,
          show: true
        }
      },
      {
        path: 'AddCollectMoney',
        component: () => import('@/views/shop/pages/AddCollectMoney'),
        name: 'AddCollectMoney',
        meta: {
          title: '添加收费模板',
          noCache: true,
          show: false
        }
      },
      /** 运费模板 */
      {
        path: 'FreightTemplate',
        component: () => import('@/views/shop/FreightTemplate'),
        name: 'FreightTemplate',
        meta: {
          title: '运费模板',
          noCache: false,
          show: true
        }
      },
      {
        path: 'AddFreightModel',
        component: () => import('@/views/shop/pages/AddFreightModel'),
        name: 'AddFreightModel',
        meta: {
          title: '新增运费模板',
          noCache: true,
          show: false
        }
      },
      {
        path: 'EditFreightModel',
        component: () => import('@/views/shop/pages/AddFreightModel'),
        name: 'EditFreightModel',
        meta: {
          title: '编辑运费模板',
          noCache: true,
          show: false
        }
      },
      {
        path: 'ShowFreightModel',
        component: () => import('@/views/shop/pages/AddFreightModel'),
        name: 'ShowFreightModel',
        meta: {
          title: '运费模板详情',
          noCache: true,
          show: false
        }
      },
      /** 运维订单 */
      {
        path: 'DevOpsOrder',
        component: () => import('@/views/shop/DevOpsOrder'),
        name: 'DevOpsOrder',
        meta: {
          title: '运维订单',
          noCache: false,
          show: true
        }
      },
      /** 店铺信息 */
      {
        path: 'ShopInformation',
        component: () => import('@/views/shop/ShopInformation'),
        name: 'ShopInformation',
        meta: {
          title: '店铺信息',
          noCache: false,
          show: true
        }
      },
      {
        path: 'CollectMoneyMode',
        component: () => import('@/views/shop/pages/CollectMoneyMode'),
        name: 'CollectMoneyMode',
        meta: {
          title: '新增账户/编辑收款方式',
          noCache: false,
          show: false
        }
      },
      {
        path: 'EditStore',
        component: () => import('@/views/shop/pages/EditStore'),
        name: 'EditStore',
        meta: {
          title: '编辑店铺信息',
          noCache: true,
          show: false
        }
      },
      /** 员工管理 */
      {
        path: 'StaffManage',
        component: () => import('@/views/shop/StaffManage'),
        name: 'StaffManage',
        meta: {
          perms: ['GET /admin/stat/user'],
          title: '员工管理',
          noCache: false,
          show: true
        }
      },
      {
        path: 'StaffDetail',
        component: () => import('@/views/shop/pages/StaffDetail'),
        name: 'StaffDetail',
        meta: {
          perms: ['GET /admin/stat/user'],
          title: '员工信息',
          noCache: false,
          show: false
        }
      },
      /** 播报机管理 */
      {
        path: 'PlayerManagement',
        component: () => import('@/views/shop/PlayerManagementl'),
        name: 'PlayerManagement',
        meta: {
          title: '播报机管理',
          noCache: false,
          show: true
        }
      },
      {
        path: 'AddBroadcastMachine',
        component: () => import('@/views/shop/pages/AddBroadcastMachine'),
        name: 'AddBroadcastMachine',
        meta: {
          title: '新增播报机',
          noCache: false,
          show: false
        }
      },
      {
        path: 'EditBroadcastMachine',
        component: () => import('@/views/shop/pages/EditBroadcastMachine'),
        name: 'EditBroadcastMachine',
        meta: {
          title: '编辑播报机',
          noCache: false,
          show: false
        }
      },
      {
        path: 'PlayerDetail',
        component: () => import('@/views/shop/pages/PlayerDetail'),
        name: 'PlayerDetail',
        meta: {
          title: '播报机详情',
          noCache: false,
          show: false
        }
      },
      /** 门店管理 */
      {
        path: 'stores',
        component: () => import('@/views/shop/stores'),
        name: 'Stores',
        meta: {
          perms: ['GET /admin/stat/user'],
          title: '门店管理',
          noCache: false,
          show: true
        }
      },
      {
        path: 'AddStore',
        component: () => import('@/views/shop/component/add/addStore'),
        name: 'AddStore',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '门店-添加门店',
          noCache: true,
          show: false
        }
      },
      {
        path: 'EditShopStore',
        component: () => import('@/views/shop/component/add/addStore'),
        name: 'EditShopStore',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '门店-编辑门店',
          noCache: true,
          show: false
        }
      },
      {
        path: 'ShowStore',
        component: () => import('@/views/shop/component/add/addStore'),
        name: 'ShowStore',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '门店-查看门店',
          noCache: true,
          show: false
        }
      },
      {
        path: 'AddContorlShop',
        component: () => import('@/views/shop/component/add/AddControlShop'),
        name: 'AddContorlShop',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '门店-添加医柜锁',
          noCache: false,
          show: false
        }
      },
      {
        path: 'StoreDetail',
        component: () => import('@/views/shop/pages/storeDetail'),
        name: 'StoreDetail',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '门店详情',
          noCache: true,
          show: false
        }
      },
      {
        path: 'ShopStoreDetails',
        component: () => import('@/views/shop/pages/ShopStoreDetails'),
        name: 'ShopStoreDetails',
        meta: {
          perms: ['GET /admin/user/list'],
          title: '门店商品详情',
          noCache: true,
          show: false
        }
      },
      {
        path: 'shopAddEquipment',
        component: () => import('@/views/shop/component/add/AddEquipment'),
        name: 'shopAddEquipment',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '门店-添加设备',
          noCache: false,
          show: false
        }
      },
      {
        path: 'AddControlShop',
        component: () => import('@/views/shop/component/add/AddControlShop'),
        name: 'AddControlShop',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '门店-添加控制器',
          noCache: false,
          show: false
        }
      },
      {
        path: 'AddMedicalCabinet',
        component: () => import('@/views/shop/component/add/AddMedicalCabinet'),
        name: 'AddMedicalCabinet',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '门店-添加医柜锁',
          noCache: false,
          show: false
        }
      },
      {
        path: 'AddStaff',
        component: () => import('@/views/shop/component/add/AddStaff'),
        name: 'AddStaff',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '新增门店员工',
          noCache: true,
          show: false
        }
      },
      {
        path: 'EditStaff',
        component: () => import('@/views/shop/component/add/AddStaff'),
        name: 'EditStaff',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '编辑门店员工',
          noCache: true,
          show: false
        }
      },
      {
        path: 'CMmanagement',
        component: () => import('@/views/shop/component/add/CMmanagement'),
        name: 'CMmanagement',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '医柜锁商品管理',
          noCache: false,
          show: false
        }
      },
      {
        path: 'DeviceManagement',
        component: () => import('@/views/shop/component/add/DeviceManagement'),
        name: 'DeviceManagement',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '设备管理',
          noCache: false,
          show: false
        }
      },
      {
        path: 'DeviceViewDetails',
        component: () => import('@/views/shop/component/add/DeviceViewDetails'),
        name: 'DeviceViewDetails',
        meta: {
          perms: ['GET /admin/stat/order'],
          title: '设备租赁详情',
          noCache: false,
          show: false
        }
      },
      /** 商品标签 */
      {
        path: 'ProductLabel',
        component: () => import('@/views/shop/ProductLabel'),
        name: 'ProductLabel',
        meta: {
          perms: ['GET /admin/user/list'],
          title: '标签管理',
          noCache: false,
          show: true
        }
      },
      /** 商品分类 */
      {
        path: 'CommodityClassification',
        component: () => import('@/views/shop/CommodityClassification'),
        name: 'CommodityClassification',
        meta: {
          perms: ['GET /admin/user/list'],
          title: '分类管理',
          noCache: false,
          show: true
        }
      },
      {
        path: 'TabManagement',
        component: () => import('@/views/shop/pages/tabManagement'),
        name: 'TabManagement',
        meta: {
          perms: ['GET /admin/user/list'],
          title: '标签管理',
          noCache: false,
          show: false
        }
      },
      {
        path: 'HospitalManagement',
        component: () => import('@/views/shop/hospitalManagement'),
        name: 'HospitalManagement',
        meta: {
          title: '医院管理',
          noCache: true,
          show: true
        }
      },
      {
        path: 'channelLink',
        component: () => import('@/views/shop/pages/channelLink'),
        name: 'channelLink',
        meta: {
          title: '医院渠道链接',
          noCache: true,
          show: false
        }
      },
      {
        path: 'AddChannelLink',
        component: () => import('@/views/shop/component/add/AddChannelLink'),
        name: 'AddChannelLink',
        meta: {
          title: '新增渠道链接',
          noCache: true,
          show: false
        }
      },
      {
        path: 'EditChannelLink',
        component: () => import('@/views/shop/component/add/AddChannelLink'),
        name: 'EditChannelLink',
        meta: {
          title: '编辑渠道链接',
          noCache: true,
          show: false
        }
      },
      {
        path: 'addHospital',
        component: () => import('@/views/shop/pages/AddHospital'),
        name: 'addHospital',
        meta: {
          title: '新增医院',
          noCache: false,
          show: false
        }
      },
      {
        path: 'editHospital',
        component: () => import('@/views/shop/pages/AddHospital'),
        name: 'editHospital',
        meta: {
          title: '编辑医院',
          noCache: false,
          show: false
        }
      },
      {
        path: 'vipManagement',
        component: () => import('@/views/shop/vipManagement'),
        name: 'vipManagement',
        meta: {
          title: '会员',
          noCache: true,
          show: true
        }
      },
      {
        path: 'addMember',
        component: () => import('@/views/shop/pages/AddMember'),
        name: 'addMember',
        meta: {
          title: '新增会员',
          noCache: false,
          show: false
        }
      },
      {
        path: 'editMember',
        component: () => import('@/views/shop/pages/AddMember'),
        name: 'editMember',
        meta: {
          title: '编辑会员',
          noCache: false,
          show: false
        }
      },
      {
        path: 'editLevel',
        component: () => import('@/views/shop/pages/editLevel'),
        name: 'editLevel',
        meta: {
          title: '编辑vip',
          noCache: false,
          show: false
        }
      },
      /* {
        path: 'accountManagement',
        component: () => import('@/views/shop/accountManagement'),
        name: 'accountManagement',
        meta: {
          title: '账户管理',
          noCache: true,
          show: true
        }
      },*/
      {
        path: 'recoveryManagement',
        component: () => import('@/views/shop/recoveryManagement'),
        name: 'recoveryManagement',
        meta: {
          title: '回收点管理',
          noCache: true,
          show: true
        }
      },
      {
        path: 'addRecovery',
        component: () => import('@/views/shop/pages/AddRecovery'),
        name: 'addRecovery',
        meta: {
          title: '新增回收点',
          noCache: false,
          show: false
        }
      },
      {
        path: 'editRecovery',
        component: () => import('@/views/shop/pages/AddRecovery'),
        name: 'editRecovery',
        meta: {
          title: '编辑回收点',
          noCache: false,
          show: false
        }
      },
      {
        path: 'smallRoutineManagement',
        component: () => import('@/views/shop/smallRoutineMainPage'),
        name: 'smallRoutineManagement',
        meta: {
          title: '小程序设置',
          noCache: false,
          show: true
        }
      }
    ]
  },
  {
    path: '/profile',
    component: Layout,
    redirect: 'noredirect',
    alwaysShow: true,
    children: [
      {
        path: 'ModifyPwd',
        name: 'ModifyPwd',
        component: () => import('@/views/profile/ModifyPwd'),
        meta: {
          title: '修改密码', noCache: false,
          show: false
        }
      },
      {
        path: 'notice',
        component: () => import('@/views/profile/notice'),
        name: 'notice',
        meta: {
          title: '通知中心', noCache: false,
          show: true
        }
      }
    ],
    hidden: true
  },

  { path: '*', redirect: '/404', hidden: true }
]

const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
